/*
 * Copyright 2020 wangruiCoder owner
 */

package org.disk.frame.logger.event;

/**
 * 类描述
 * <p>详细描述</p>
 *
 * @author kyrie 2021/4/22 5:08 下午
 * @since jdk1.8
 */
public class HttpLog extends AbstractLogEvent{
    private static final long serialVersionUID = -8842830455398872644L;
    private String remoteIp;
    private String url;
    private String appIp;
    private String appName;
    private Long startTime;
    private Long endTime;
    private long time;

    /**
     * Create a new {@code ApplicationEvent}.
     *
     * @param source the object on which the event initially occurred or with
     *               which the event is associated (never {@code null})
     */
    public HttpLog(Object source) {
        super(source);
    }

    public HttpLog remoteIp(String remoteIp){
        this.remoteIp = remoteIp;
        return this;
    }

    public HttpLog url(String url){
        this.url = url;
        return this;
    }

    public HttpLog appIp(String appIp){
        this.appIp = appIp;
        return this;
    }

    public HttpLog appName(String appName){
        this.appName = appName;
        return this;
    }

    public HttpLog startTime(Long startTime){
        this.startTime = startTime;
        return this;
    }

    public HttpLog endTime(Long endTime){
        this.endTime = endTime;
        return this;
    }

    public HttpLog time(long time){
        this.time = time;
        return this;
    }

    public String getRemoteIp() {
        return remoteIp;
    }

    public String getUrl() {
        return url;
    }

    public String getAppIp() {
        return appIp;
    }

    public String getAppName() {
        return appName;
    }

    public Long getStartTime() {
        return startTime;
    }

    public Long getEndTime() {
        return endTime;
    }

    public long getTime() {
        return time;
    }

    @Override
    public String toString() {
        return "HttpLog{" +
                "remoteIp='" + remoteIp + '\'' +
                ", url='" + url + '\'' +
                ", appIp='" + appIp + '\'' +
                ", appName='" + appName + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", time=" + time +
                '}';
    }
}
